package com.simpleim.common.task;

import com.simpleim.util.ThreadUtil;

import java.util.concurrent.*;

/**
 * 自定义线程池
 */
public class FutureTaskScheduler {

    /**
     * 线程池
     */
    private static ExecutorService poolExecutor;

    static {
        poolExecutor = ThreadUtil.getMixedThreadPool();
    }

    /**
     * 提交任务
     * @param task
     */
    public static void add(ExecuteTask task) {
        poolExecutor.submit(() -> {
            task.execute();
        });
    }

}
